$(function(){
    var ajaxFill = new Z.AjaxFill({
        url: Z.url('/entry/records/'+TYPE,true),
        templates: {
            list: '<li>\
                    <b class="triangle"></b>\
                    <span class="date">${created_at}</span>\
                    <a href="${SITE_URL}/index.php/entry/show/${TYPE}/${id}">${title}</a>\
                </li>',
            none: '',
            loading: '<li style="text-align:center;"><img src="/assets/img/backend/loading.gif"/></li>'
        },
        data: {
            pageSize : 25
        },
        containers: {
            list: $('.list-container ul'),
            pageLinks: $('.list-container .page-links')
        }
    });
    
    ajaxFill.request();
    
    $('.search-container a').click(function(){
        if(LANG == 'en'){
            ajaxFill.request({
                title_en : $(this).prev().val()
            });
        }else{
            ajaxFill.request({
                title : $(this).prev().val()
            });
        }
    });
});